Just checking the logic.


In [2]:
from dcprogs.likelihood import plot_time_series
from dcprogs.likelihood.random import time_series as random_time_series

perfect, series = random_time_series(N=100, n=100, tau=1)
print(perfect)
plot_time_series(perfect)
plot_time_series(series, ax=gca(), marker='*', color='k', linestyle=':')
display(gcf())


[   0.            9.51235331   14.47921626   21.60547112   31.08378628
   35.69457123   40.51950132   44.74654158   54.54794362   60.30203895
   63.44080552   72.28616454   79.7854377    85.86666151   89.21338079
   93.7228207    96.8654923   100.47825305  109.06813506  112.81541439
  121.96371352  131.93568399  136.3717682   143.22993143  149.05642408
  157.95258445  164.93922787  169.26521736  173.49128143  178.90746825
  183.25740581  187.37824961  193.56636613  199.49724952  203.2394494
  212.11297517  216.74845766  220.36043474  229.54388904  236.7664997
  241.42168319  247.19108157  255.6786496   261.42066557  269.53469734
  275.90925614  282.80484029  289.44365414  296.44466522  300.51429713
  304.37909475  313.24841367  319.15451898  325.77935838  329.10581716
  332.23532138  342.12056559  349.36016427  352.41038435  359.41190969
  362.84854236  369.22406606  379.2130415   385.61117826  390.42357277
  396.79599478  402.17062703  408.26225312  411.78281493  417.71203678
  422.39718271  428.3501811   433.16328893  440.56968616  444.20437384
  448.16387175  455.93128095  463.07111575  467.19247898  470.78031606
  474.11947294  478.16095045  486.83678313  490.66898187  497.47654646
  505.757151    512.57152134  518.66543367  523.11984987  527.40963415
  530.48626481  539.93202085  549.66110202  553.82867599  557.21631753
  562.88498787  569.6992243   578.23394441  582.87859527  590.74201308
  599.55392332]

In [3]:
from dcprogs.likelihood import time_filter as cpp_time_filter
filtered = cpp_time_filter(series, 1)
plot_time_series(perfect)
plot_time_series(filtered, ax=gca(), marker='*', color='k', linestyle=':')
display(gcf())


Now, computes the likelihood of this time series for a random QMatrix